//# sourceURL=http://uMapApp/Earth/DataSourceView/GEOJSONDataSourceView
define([
    "mhjs/mhjs",
    "uMap/uMap",
    "uEarth/uEarth",
    "./EntityDataSourceView"
], function (
    mhjs,
    uMap,
    uEarth,
    EntityDataSourceView
) {

    function GEOJSONDataSourceView(option) {

        var _this = this;
        EntityDataSourceView.call(_this, option);

        _this.dataSource = new uMap.GeoJSONCollection(option);
        _this.dataSource.load();


    }

    var _class = GEOJSONDataSourceView;

    mhjs.Inherit(_class, EntityDataSourceView);

    Object.defineProperties(_class.prototype, {
        "open" : {
            value: function () {

                var _this = this;

                if (!_this.isOpened) {

                    _this.dataSource.show = true;
                    _this.isOpened = true;

                    this.trigger("open");
                    this.trigger("toggle");
                }
            }
        },
        "close": {
            value: function () {

                var _this = this;

                if (_this.isOpened) {

                    _this.dataSource.show = false;
                    _this.isOpened = false;

                    this.trigger("close");
                    this.trigger("toggle");

                }
            }
        }
    });

    return _class;

});